package eu.jk.data.dbcp;

import java.sql.Connection;

/**
 * 连接包装
 * 
 * @author wzz
 * 
 */
public class Wraper {
	long lastActive;
	Connection conn;
	boolean lended = false;

	/**
	 * @param conn
	 */
	public Wraper(Connection conn) {
		this.conn = conn;
		lastActive = System.currentTimeMillis();
	}

	/**
	 * @return the lastActive
	 */
	public long getLastActive() {
		return lastActive;
	}

	/**
	 * @return the conn
	 */
	public Connection getConnection() {
		return conn;
	}

	public void notifyActive() {
		lastActive = System.currentTimeMillis();
	}

	public void notifyLend() {
		this.lended = true;
	}

	public void notifyReturn() {
		this.lended = false;
	}

	public boolean hasLended() {
		return lended;
	}
}
